<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <!-- 最新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/css/bootstrap.min.css">

    <!-- 可选的Bootstrap主题文件（一般不用引入） -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/css/bootstrap-theme.min.css">

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>

    <style media="screen">
    .shadow {position:fixed; width:100%; height:100%; background:#000; opacity:0.3; filter:alpha(opacity:30);left:0; top: 0;}
    .mod_dialog {width:300px; height:200px; border:1px solid black; background:#fff; position:fixed; left:50%; top:50%; margin-left:-150px; margin-top:-100px}
    </style>
    <title></title>
  </head>
  <body>
    <div class="page">
      <ul class="nav nav-tabs">
        <li role="presentation"> <a href="/admin/">管理首页</a></li>
        <li role="presentation"><a href="/admin/banners">banner设置</a></li>
        <li role="presentation" class="active"><a href="/admin/custom">custom</a></li>
        <li role="presentation"><a href="/admin/blog">blog</a></li>
        <li role="presentation"><a href="/admin/contact">联系方式</a></li>
        <li role="presentation"><a href="/admin/msg">留言管理</a></li>
        <li role="presentation"><a href="/admin/aboutMe">我的信息</a></li>
      </ul>
      <div class="content-wrap">
        <div>
          <form action="?" method="post" enctype="multipart/form-data" role="form">
            <label for="title"> 标题：</label>
            <input type="text" name="title" id="title" class="form-control" placeholder="请输入标题内容"/>
            <label for="description"> 描述：</label>
            <textarea name="description" id="description" class="form-control" rows="5" placeholder="输入描述内容"></textarea>
            <label for="f1"> 头像：</label>
            <input type="file" name="f1" id="f1" placeholder="选择文件"/>
            <button type="submit" class="btn btn-default">添加</button>
          </form>
        </div>
        <table border="1" width="100%">
          <thead>
            <tr>
              <th>ID</th>
              <th>标题</th>
              <th>描述</th>
              <th>头像</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            <% for(var i=0;i<evaluations.length;i++){ %>
            <tr>
              <td><%=evaluations[i].ID%></td>
              <td><%=evaluations[i].title%></td>
              <td><%=evaluations[i].description%></td>
              <td><img width="32" height="32" src="/upload/<%=evaluations[i].src%>"/></td>
              <td>
                <a href="?act=mod&id=<%=evaluations[i].ID%>">修改</a>
                <a href="?act=del&id=<%=evaluations[i].ID%>" onclick="return confirm('你真的要删吗？')">删除</a>
              </td>
            </tr>
            <% } %>
          </tbody>
        </table>
        <% if(typeof mod_data!='undefined'){ %>
        <div class="shadow"></div>
        <div class="mod_dialog">
          <form action="?" method="post" enctype="multipart/form-data">
            <input type="hidden" name="mod_id" value="<%= mod_data.ID %>" />
            标题：<input type="text" name="title" value="<%= mod_data.title %>" /><br>
            描述：<textarea name="description"><%= mod_data.description %></textarea><br>
            头像：<input type="file" name="f1" /><br>
            <input type="submit" value="修改"/>
            <a href="/admin/custom">取消修改</a>
          </form>
        </div>
        <% } %>
      </div>
    </div>
  </body>
</html>
